#ifndef __REQUEST_H__
#define __REQUEST_H__

#include <iostream>
#include <fstream>
#include "Global.h"
#include <sstream>
#include <string>
#include <cstring>
#include <map>
#include "Response.h"
#include "Cache.h"
using namespace std;

class Request {
protected:
    string method; // method -- one of GET, PUT, DELETE, OPTIONS, CONNECT, TRACE, POST, HEAD
    string uri; // Not checked at this point
    string version; // Should it be a float??
    map<string, string> headers;
public:
    Request(); // Default Constructor
    Request(stringstream& s); // Parse a string into a request
    Request(Request& orig); // Copy constructor
    ~Request(); // Destructor
    static Request * Create(stringstream& s);
    virtual Response processRequest() = 0; // Do I need a return code??
    virtual void PrintInfo() = 0;
    string GetMethod();
    string GetUri();

    friend ostream& operator<<(ostream& outs, Request& req);
private:
    map<string,bool> GetRequestHeaderFieldMap();
};


#endif
